package ru.evreke.service.game.pending

import Game
import org.koin.core.context.GlobalContext
import ru.evreke.service.State

class PendingGamesService {
    private val state by GlobalContext.get().inject<State>()
    fun getPendingGames(): List<String> = state.getPendingGames().map { it.key }

    fun getPendingGame(gameId: String): Game? = state.getPendingGames()[gameId]


    fun addPendingGame(gameId: String, game: Game) {
        state.addPendingGame(gameId, game)
    }

    fun removePendingGame(gameId: String) {
        state.getPendingGames()[gameId]
    }
}